package com.example.boot6rabbitmqalipay.dao;

import com.example.boot6rabbitmqalipay.bean.Message;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface MessageMapper {

    @Update("update zg_message set state = #{state} where message_id = #{message_id}")
    int updateMessage(Message message);

    @Insert("insert into zg_message(user_id,message_id,amount,state) values(#{user_id},#{message_id},#{amount},'unconfirm')")
    int addMessage(Message message);

    @Select("select * from zg_message where state = #{state}")
    List<Message> queryMessageByState(String state);
}
